<template>
	<view class="centerXY agreement-box">
		<view class="mar-right-12 icon-box centerXY" @click="hanldeCheckbox">
			<u-icon v-if="checkbox" size="16" color="#0055FE" name="checkbox-mark"></u-icon>
		</view>
		<view class="font-24 color-grey">
			同意并接受
			<text class="color-primary" @click="hanldeAgreement('user_private_agreement','用户隐私协议')">《用户隐私协议》</text>
			 <!-- 和 -->
			<!-- <text class="color-primary" @click="hanldeAgreement('service_agreement','服务协议')">《服务协议》</text> -->
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			checkbox: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			}
		},
		methods: {
			// 跳转协议页面
			hanldeAgreement(code, text) {
				uni.navigateTo({
					url: '/pages/agreement/agreement?code=' + code + '&text=' + text
				})
			},
			// 改变状态
			hanldeCheckbox() {
				this.$emit('hanldeCheckbox')
			},
		}
	}
</script>

<style scoped lang="scss">
	.icon-box {
		width: 34rpx;
		flex-shrink: 0;
		height: 34rpx;
		border: 1rpx solid #646464;
		border-radius: 50%;
	}
</style>